#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QGridLayout>
#include <QLineEdit>
#include <QProgressBar>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void okBtClicked();
    void activeProgressSlot();
    void waitProgressSlot();
    void shelfProgressSlot();
    
private:
    void initDefaultParam();
    void updateParam();
    void addLineEdit(QLineEdit *lineEdit, QGridLayout *gridLayout, int row, int col);
    void initProgressBar(QProgressBar *progresss, QGridLayout * gridLayout, const QString &label, int row);

    QLineEdit *shelfSizeParam;
    QLineEdit *rCountParam;
    QLineEdit *rTimeParam;
    QLineEdit *wCountParam;
    QLineEdit *wTimeParam;

    int shelfSize;
    int readerCount;
    int readTime;
    int writerCount;
    int writeTime;

    QProgressBar *shelfProgress;
    QProgressBar *activeProgress;
    QProgressBar *waitProgress;
};

#endif // MAINWINDOW_H
